<extend name="Public:base" />

<block name="content-wrapper">
	<!-- Content Wrapper. Contains page content -->
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<h1>
				我的信息
				<small>My Information</small>
			</h1>
			<ol class="breadcrumb">
				<li>
					<a href="{:U('Index/index')}"> <i class="fa fa-dashboard"></i>
						首页
					</a>
				</li>
				<li class="active">我的信息</li>
			</ol>
		</section>

		<!-- Main content -->
		<section class="content">
			<div class="row">
				<div class="col-md-6 col-md-offset-3">
					<div class="box">
						<div class="box-header with-border">
							<h3 class="box-title">详细信息</h3>
						</div>
						<!-- /.box-header -->
						<div class="box-body">
							<form class="form-horizontal">
								<php>
									$major_id = $student['class']['major_id'];
									$major = get_major_by_id($major_id);
									$academy_id = $major['academy_id'];
									$academy = get_academy_by_id($academy_id);
								</php>
								<div class="form-group">
									<label class="col-sm-2 control-label">学号</label>
									<div class="col-sm-9">
										<p class="form-control">{$student['id']}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">姓名</label>
									<div class="col-sm-9">
										<p class="form-control">{$student['name']}</p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">所在班级</label>
									<div class="col-sm-9">
										<p class="form-control">{$academy.name} {$student.class.grade}级 {$major.name} {$student.class.class}班</p>
									</div>
								</div>
							</form>
						</div>
						<!-- /.box-body -->
						<div class="box-footer">
							<!-- <a class="btn btn-default pull-right">修改密码</a> -->
						</div>
						<!-- /.box-footer -->
					</div>
					<div class="box">
						<div class="box-header with-border">
							<h3 class="box-title">修改密码</h3>
						</div>
						<!-- /.box-header -->
						<!-- form start -->
						<div class="box-body">
							<form id="form-password" class="form-horizontal" action="{:U('MyInformation/changePassword')}" method="post">
								<input name="id" type="hidden" value="">
								<div class="form-group">
									<label class="col-sm-2 control-label">旧密码</label>
									<div class="col-sm-9">
										<input name="old_password" id="old_password" type="password" class="form-control">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">新密码</label>
									<div class="col-sm-9">
										<input name="password" id="password" type="password" class="form-control">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">新密码</label>
									<div class="col-sm-9">
										<input name="repassword" id="repassword" type="password" class="form-control">
									</div>
								</div>																
							</form>
						</div>
						<!-- /.box-body -->
						<div class="box-footer">
							<button id="button-password-submit" type="button" class="btn btn-info pull-right">确定</button>
						</div>
						<!-- /.box-footer -->
					</div>
				</div>
			</div>
		</section>
		<!-- /.content -->
	</div>
	<!-- /.content-wrapper -->
</block>

<block name="additional-scripts">
	<script>
	$(function() {
		$('#button-password-submit').click(function() {
			$('#form-password').submit();
		});
	});	
	</script>
</block>